package com.hx.vending.service;

import com.hx.vending.bean.Region;
import com.hx.vending.bean.User;
import com.hx.vending.bean.entity.*;
import com.hx.vending.util.Msg;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/11/27.
 */
public interface IUserService {

    User selectByPrimary(@Param("userPhone") String userPhone);

    User findByUserPhone(@Param("userPhone") String userPhone);

    int insertByPhone(@Param("user") User user);
    //获取验证码
    Msg pushMessageByPhone(@Param("phone")String phone,@Param("condition")String condition);

    Msg verifyCode(@Param("code")String code,@Param("code") String msgId);

    int updatePassword(String userPhone,String userPassWord);

    Msg getUnderOrderTod(Integer userId, List<Integer> fieldList, String startTime, String endTime);

    Msg getOnlineOrderTod(Integer userId, List<Integer> fieldList, String startTime, String endTime);

    Double getEarningsToday(Integer userId, List<Integer> fieldList, String startTime, String endTime);

    Msg statisticalGain(Integer userId,Integer[] integers, String condition);

    User selectByPrimaryKey(User user);

    int updateByPrimaryKeySelective(User user);

    Msg getNumberByUserId(Integer userId);

    Msg updateCustomService(User user);

    Msg updateuserServicePhone(Integer userId,String userServicePhone);

    Msg updateuserMerchantName(Integer userId,String userMerchantName);

    Msg getUserByUserId(Integer userId,Integer account);

    List<User> selectByExample(User user);

    List<RegionVo> selectRegionOne();

    List<RegionDetailVo> selectRegionVoByPid(Integer regionPid);

    List<Region> selectRegionByPid(Integer regionPid);

    UserService selectUserServiceById(Integer userId);

    int deleteByPrimaryKey(Integer userId);

    User selectUserById(Integer userId);

    /**
     * 查询工商信息
     * @param userId
     * @return
     */
    UserVO selectBankByUserId(Integer userId);

    List<UserAudit> selectUserBankList(String userName, String state, String startTime, String endTime,Integer pageStart);

    Integer selectUserNum(String userName,String userPhone);

    List<User> selectUserBack(Map<String,Object> map);

    /**
     * 保存商户提现信息
     * @param user
     * @return
     */
    Msg updateUserDrawCashMessage(Integer userId, User user);

    int updateSecondaryPassword(String userPhone, String userPassWord);
    /**
     * 验证二级密码
     * @param userId
     * @param secondaryPassword
     * @return
     */
    Msg selectVerificationSecondaryPassword(Integer userId, String secondaryPassword);

    /**
     * 查询商户的提现比例
     * @param userId
     * @return
     */
    Msg selectUserWithdrawProportion(Integer userId);

    /**
     * 修改商户提现比例
     * @param userId
     * @return
     */
    Msg updateUserWithdrawProportion(Integer userId, Float withdrawProportion);

    int deleteBatchByList(List<Integer> integerList);

    Msg selectSubAccount(Integer userId,String userName);

    Msg selectSubAccountDetails(Integer account);

    int updateSubAccount(Integer userId,String userName, String userPassWord,String userPhone,String roleId,String fieldId);

    Msg editSubAccountUse(Integer account,Integer subsidiaryUse);

    User selectUserDetailsById(Integer userId);
    /**
     * 查询登陆账号的权限
     * @param userId
     * @return
     */
    Msg selectUserOperation(Integer userId);

}
